import java.util.Scanner;

/**
   Counts the number of words in a line.
   Input: a string containing the line
   Output: the number of words in the line
*/
public class CountWords
{
   public static void main(String[] args)
   {
      // your work here
      int count = 0;
      String t="";

      Scanner in = new Scanner(System.in);
      while (in.hasNext())
      {
         // more work here
         t = in.nextLine();
         for(int i = 0;i < t.length();i++){
             if(t.charAt(i) == ' '){
                 count++;
             }
         }

      }

      // more work here
      count++;

      System.out.println(count);
   }
}